<?php

namespace Kunfeng\Dify\Model\Workflow;

/**
 * 工作流停止响应模型
 */
class WorkflowStopResponse
{
    private $result;
    private $message;

    public function __construct(array $data)
    {
        $this->result = $data['result'] ?? '';
        $this->message = $data['message'] ?? '';
    }

    /**
     * 从数组创建
     */
    public static function fromArray(array $data): self
    {
        return new self($data);
    }

    // Getters
    public function getResult(): string
    {
        return $this->result;
    }

    public function getMessage(): string
    {
        return $this->message;
    }

    /**
     * 判断是否成功
     */
    public function isSuccess(): bool
    {
        return $this->result === 'success';
    }
}